package cn.joeg.app.css.util.date;


import java.util.Date;

public class TimeUtil {

    public static final String msf = "yyyyMMddHHmmssSSS";
    public static final String sf = "yyyyMMddHHmmss";
    public static final String mf = "yyyyMMddHHmm";
    public static final String hf = "yyyyMMddHH";
    public static final String df = "yyyyMMdd";
    public static final String Mf = "yyyyMM";
    public static final String M_F = "yyyy/MM";
    public static final String M_D_F = "yyyy/MM/dd";
    public static final String yf = "yyyy";
    public static final String yyyy_D_MM = "yyyy.MM";


    public static final String yyyy_MM_dd_HH_mm_ss_SSS = "yyyy-MM-dd HH:mm:ss:SSS";
    public static final String yyyy_MM_dd_HH_mm_ss_D_SSS = "yyyy-MM-dd HH:mm:ss.SSS";
    public static final String MM_dd_HH_mm_ss = "MM-dd HH:mm:ss";
    public static final String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
    public static final String yyyy_MM_dd = "yyyy-MM-dd";
    public static final String yyyy_MM = "yyyy-MM";

    public static String getString(String pattern) {
        return JodaDateHelper.formatDate(new Date(), pattern);
    }

    public static long getLong(String pattern) {
        return Long.parseLong(JodaDateHelper.formatDate(new Date(), pattern));
    }

    public static long nowLong() {
        return System.currentTimeMillis();
    }

    public static int nowInt() {
        return (int) (nowLong() / 1000);
    }


}
